﻿using LowCoding.Common;
using LowCoding.Dto;
using LowCoding.Dto.Sys;

namespace LowCoding.Application.Sys.Right
{
    public interface ISysRightService
    {

        /// <summary>
        /// 根据模块代码模块id集合
        /// </summary>
        /// <param name="mdlCode"></param>
        /// <returns></returns>
        Task<List<string>> GetIds(string mdlCode);

        /// <summary>
        /// 根据用户id查询用户权限
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<List<TreeMainDto>> GetRoleRightsMod(string userId);

        /// <summary>
        /// 根据roleId查询所有的菜单信息并标注权限是否拥有
        /// </summary>
        /// <param name="roleid"></param>
        /// <param name="mdlCode"></param>
        /// <returns></returns>
        Task<List<TreeSysRightDto>> GetSysRoleRights(string roleid, string mdlCode);

        /// <summary>
        /// 判断当前登录用户是否管理员
        /// </summary>
        /// <returns></returns>
        Task<bool> IsAdminAsync();

        /// <summary>
        /// 更新角色权限
        /// </summary>
        /// <param name="roleid"></param>
        /// <param name="rights"></param>
        /// <param name="mdlCode"></param>
        /// <returns></returns>
        Task<ResponseMessageModel> SysRightUpdate(string roleid, List<string> rights/*, string mdlCode = ""*/);
    }
}